package com.example.aboutspringboot.service;

import com.example.aboutspringboot.entity.ShopCar;
import com.example.aboutspringboot.mapper.ShopCarMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShopCarService {

    @Resource
    private ShopCarMapper shopCarMapper;

    public List<ShopCar> selectShopCar(String username) {
        return shopCarMapper.selectShopCar(username);
    }

    public int insertShopCar(ShopCar shopCar) {
        return shopCarMapper.insertShopCar(shopCar);
    }

    public int updateShopCar(ShopCar shopCar) {
        return shopCarMapper.updateShopCar(shopCar);
    }

    public int deleteShopCar(String username) {
        return shopCarMapper.deleteShopCarAll(username);
    }

    public int deleteShopCarByNum(String username,long id){
        return shopCarMapper.deleteShopCarByNum(username,id);
    }

    public ShopCar selectShopCarByIdAndName(String username,long id){
        return shopCarMapper.selectShopCarByIdAndName(username,id);
    }
}
